﻿@{
	Layout = "~/Views/Shared/_Layout.cshtml";
}

<link href="~/Content/assets/css/common.css" rel="stylesheet" />
<link href="~/Content/assets/css/company_ajax_dialog.css" rel="stylesheet" />
<link href="~/Content/assets/plugin/js_pagination/yPagination.css" rel="stylesheet" />

<script src="~/Content/assets/lib/jquery-1.8.2.min.js"></script>
<script src="~/Content/assets/plugin/yHelper.js"></script>
<script src="~/Content/assets/js/common/comHelper.js"></script>
<script src="~/Content/assets/js/member/memberHelper.js"></script>
<script src="~/Content/assets/plugin/js_pagination/yPagination.js"></script>





@* 统一的系统提示框 *@
@*
	remind :提醒图标  success：对勾图标  tip_anim_close：关闭class
	<div class="disappear_tooltip pie_about success tip_anim remind" style="top:50%;left:50%;margin-top:-35px;margin-left:-80px;">
*@
<div id="comTipsDiv" class="disappear_tooltip pie_about tip_anim tip_anim_close" style="position:fixed; top:50%;left:50%;margin-top:-35px;margin-left:-80px;">
	<div class="icon"></div>
	<div class="content"></div>
</div>

<script>
	$(function () {
		(function (window) {
			init();
			function init() {
				//统一提示框帮助类
				var comTipsHelper = {
					clearTimeout: null,
					//示例：
					//remind、success
					//comTipsHelper.disappearTips('remind','提示信息');
					disappearTips: function (className, msg, callback) {
						if (!!comTipsHelper.clearTimeout) {
							clearTimeout(comTipsHelper.clearTimeout);
						}
						var $comTipsDiv = $("#comTipsDiv");
						$comTipsDiv.removeClass("remind").removeClass("success");
						if (!!className) {
							$comTipsDiv.removeClass("tip_anim_close").addClass(className);
						}
						if (!msg) {
							msg = '';
						}
						$comTipsDiv.children(".content").html(msg);
						comTipsHelper.clearTimeout = setTimeout(function () {
							$comTipsDiv.addClass("tip_anim_close");
							if (!!callback && $.isFunction(callback)) {
								callback();
							}
						}, 2000)
					}
				}
				window.comTipsHelper = comTipsHelper;
			}
		})(window)
	})
</script>






@* 统一登录导航 *@

@* --头部开始-- *@
<div class="header_min">
	<div class="header_min_top">
		<div class="itopl font_gray6 link_gray6">
			<span class="link_yellow">
				欢迎登录优青网！
				<span id="topinf">
					@*<a href="javascript:void(0)">芽组织</a>&nbsp;&nbsp;<a href="javascript:void(0)">注销</a>*@
					@*请 <a href="/member/login">登录</a> 或 <a href="/member/register">免费注册</a>*@
				</span>
			</span>
		</div>
		<div class="itopr font_gray9 link_gray6 substring">
			<a href="/" class="home">网站首页</a>
			@*|<a href="javascript:void(0)" class="m">手机访问</a>*@
			@*|<a href="javascript:void(0)" class="help">帮助中心</a>*@
		</div>
		<div class="clear"></div>
	</div>
</div>
@* --头部结束-- *@
<script>
	$(function () {
		(function (window) {

			//顶部登录帮助类
			var loginTopHelper = {
				/*调用方式：
				loginTopHelper.getUserInfo({
					loginFunc: function(resp){

					},
					notLoginFunc: function(resp){

					},
				})
				*/
				getUserInfo: function (obj) {
					if (!obj.loginFunc || !$.isFunction(obj.loginFunc)) {
						console.error("请填写登录成功后的回调函数:loginFunc");
						return;
					}
					if (!obj.notLoginFunc || !$.isFunction(obj.notLoginFunc)) {
						obj.notLoginFunc = function () { };
					}
					$.ajax({
						url: "/member/usrinf",
						type: "post",
						datatype: "json",
						timeout: 3000,
						success: function (resp) {
							if (resp.result == 1) { //登录
								obj.loginFunc(resp);
							} else { //未登录
								obj.notLoginFunc(resp);
							}
						},
						complete: function (XMLHttpRequest, status) {
							if (status == 'timeout') {	//超时

							} else if (XMLHttpRequest.status != "200") {	//返回失败状态

							}
						}
					})
				},
				//注销
				/*调用方式：
				loginTopHelper.logout({
					logoutFunc:function(resp){
						
					}
				})
				*/
				logout: function (obj) {
					if (!obj || !obj.logoutFunc || !$.isFunction(obj.logoutFunc)) {
						obj.logoutFunc = function () { }
					}
					$.ajax({
						url: "/member/logout",
						type: "post",
						datatype: "json",
						timeout: 3000,
						success: function (resp) {
							obj.logoutFunc(resp);
						},
						complete: function (XMLHttpRequest, status) {
							if (status == 'timeout') {	//超时

							} else if (XMLHttpRequest.status != "200") {	//返回失败状态

							}
						}
					})
				}
			}
			window.loginTopHelper = loginTopHelper;




			loginTopHelper.getUserInfo({
				loginFunc: function (resp) {
					var html = '<a href="/m">' + resp.data.name + '</a>&nbsp;&nbsp;<a id="btnTopLogout" href="javascript:void(0)">注销</a>';
					document.getElementById("topinf").innerHTML = html;
					logoutEvent();
				},
				notLoginFunc: function (resp) {
					var html = '请 <a href="/member/login">登录</a> 或 <a href="/member/register">免费注册</a>';
					document.getElementById("topinf").innerHTML = html;
				},
			})

			//注销
			function logoutEvent() {
				$("#btnTopLogout").unbind("click");
				$("#btnTopLogout").bind("click", function () {
					loginTopHelper.logout({
						logoutFunc: function (resp) {
							if (resp.result == 1) { //注销成功
								location.reload(true);
							} else if (resp.result == 0) { //注销失败

							} else { //操作非法

							}
						}
					})
					//$.ajax({
					//	url: "/member/logout",
					//	type: "post",
					//	datatype: "json",
					//	timeout: 3000,
					//	success: function (resp) {
					//		if (resp.result == 1) { //注销成功
					//			location.reload(true);
					//		} else if (resp.result == 0) { //注销失败

					//		} else { //操作非法

					//		}
					//	},
					//	complete: function (XMLHttpRequest, status) {
					//		if (status == 'timeout') {	//超时

					//		} else if (XMLHttpRequest.status != "200") {	//返回失败状态

					//		}
					//	}
					//})
				})
			}


		})(window)
	})

</script>








@* 统一登录弹框 *@
<style>
	.modal_login_group .modal_login_right .tit .identityTab {
		width: 300px;
		height: auto;
	}

		.modal_login_group .modal_login_right .tit .identityTab .item {
			text-decoration: none;
			display: inline-block;
			line-height: 40px;
			width: 145px;
			border: 1px solid #ccc;
			text-align: center;
			border-radius: 3px;
			color: #000;
			font-size: 16px;
		}

			.modal_login_group .modal_login_right .tit .identityTab .item:hover {
				color: #fff;
				background-color: #FF4400;
			}

		.modal_login_group .modal_login_right .tit .identityTab .active {
			color: #fff;
			background-color: #FF6600;
		}
</style>


<div id="dlg_loginShadow" class="modal_backdrop fade in" style="display:none;"></div>
@* 登录弹框 开始 *@
<div class="modal" style="display:none;">
	<div class="modal_dialog" style="top: 50%; margin-top: -213px; left: 50%; margin-left: -350px;">
		<div class="modal_content pie_about no_pad">
			<div class="modal_header">
				<span class="title modal_title">会员登录</span>
				<span class="max_remind"></span>
				<a id="dlg_loginClose" href="javascript:void(0);" class="close J_dismiss_modal"></a>
			</div>
			<div class="modal_body no_pad">
				<div class="modal_login_group">
					<div class="modal_login_left"></div>
					<div class="modal_login_right">
						<div class="right_all_box">
							<div class="tit">
								<div id="dlg_identity" class="identityTab">
									<a href="javascript:void(0)" data-idt="1" class="item active">我是求职者</a>
									<a href="javascript:void(0)" data-idt="2" class="item">我是经纪人</a>
								</div>
							</div>
							<div class="login_type_group">
								<div class="type_box">
									<div id="dlg_tips" class="err J_errbox"></div>
									<div class="inputbox J_focus">
										<div class="imgbg"></div>
										<input id="dlg_username" type="text" class="input_login" placeholder="手机号/会员名/邮箱">
									</div>
									<div class="inputbox J_focus">
										<div class="imgbg pwd"></div>
										<input id="dlg_password" type="password" class="input_login pwd J_loginword" placeholder="请输入密码">
									</div>
									<div class="btnbox">
										<input id="dlg_btnLogin" class="btn_login J_hoverbut" type="button" value="登录">
									</div>
								</div>

								<div class="clear"></div>
							</div>
						</div>
					</div>
					<div class="clear"></div>
				</div>
			</div>
		</div>
	</div>
</div>
@* 登录弹框 结束 *@
<script src="~/Content/assets/js/member/logindlg.js"></script>